-- open_grid_add
-- created by zhuangsl
-- 翻开格子临时提升属性

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,
    -- 触发
    trigger = function(who, prop, targetPos)
        local propId = PropM.getPropId("attrib2");
        local p = {propId, prop[2], prop[3], -1};
        PropM.record(who, p, "special");
    end,

    desc = function(prop)
        local row = PropM.getRow(prop[1]);
        local desc = row.desc;

        local attrib = FieldsM.getFieldName(prop[2]);
        if attrib then
            desc = string.gsub(desc, "{0}", attrib);
        end

        desc = string.gsub(desc, "{1}", prop[3]);

        return desc;
    end,

    record = function(target, prop, path)
        return false;
    end
};
